<template>
  <div>
    <button @click="handleLogin">登陆11</button>
  </div>
</template>

<script setup>

import {useRouter} from "vue-router";
import {useUserStore} from '@/stores'
import {Message} from "@arco-design/web-vue";

defineOptions({name: 'Login'})
const router = useRouter()
const userStore = useUserStore()


const handleLogin = async () => {
  await userStore.login({username: 'admin', password: '123456'})
  const {redirect, ...othersQuery} = router.currentRoute.value.query
  router.push({
    path: redirect || '/',
    query: {...othersQuery}
  })
  Message.success('登录成功')
}
</script>

<style scoped>

</style>
